package com.wish.housing.controller;


import com.wish.common.core.usconfig.common.MsgResult;
import com.wish.common.security.utils.SecurityUtils;
import com.wish.housing.entity.TbPremisesInfo;
import com.wish.housing.service.ITbPremisesInfoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * <p>
 * 王泓翔-楼盘信息表	！-房态-杨子强----	刘郑欣楼盘添加	高露雯分散集中房源添加 前端控制器
 * </p>
 *
 * @author gaoluwen
 * @since 2022-03-28
 */
@RestController
@RequestMapping("/tb-premises-info")
public class TbPremisesInfoController {
    @Autowired
    ITbPremisesInfoService iTbPremisesInfoService;
    @PostMapping("list")
    public MsgResult list(@RequestBody TbPremisesInfo tbPremisesInfo){
        //1.获取当前登录的用户是谁sys_usertbPremisesInfo = {TbPremisesInfo@14776}
        Long id = SecurityUtils.getUserId();
        System.out.println(id);
        //2.知道当前用户所在地区sys_region的商户有哪些tb_business

        //3.根据名字获取楼盘信息表信息
        List<TbPremisesInfo> list = iTbPremisesInfoService.getTbPremisesInfoList(tbPremisesInfo.getName());
        return MsgResult.succeed(list);

    }
}
